// 完全可以把小仓库的数据映射成全局getters, => 快速访问
// {{ $store.getters.token }}  {{ $store.state.user.token }}

const getters = {
  sidebar: state => state.app.sidebar,
  device: state => state.app.device,
  // token(state) {
  //   return state.user.token
  // }
  token: state => state.user.token,
  name: state => state.user.userInfo.username,
  staffPhoto: state => state.user.userInfo.staffPhoto,
  routes: state => state.permission.routes,
  roles: state => state.user.userInfo.roles
}
export default getters

// {
//   total(state) {
//     return state.xxx + 100
//   },
//   total: (state) => {
//     return state.xx + 100
//   },
//   total: state => state.xx + 100
// }
